package com.cxhc.system.service.app.impl;

import java.util.List;

import com.cxhc.common.annotation.Integral;
import com.cxhc.common.enums.IntegralType;
import com.cxhc.common.utils.DateUtils;
import com.cxhc.system.domain.app.RpBuildingRubbishSort;
import com.cxhc.system.mapper.app.RpBuildingRubbishSortMapper;
import com.cxhc.system.service.app.IRpBuildingRubbishSortService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 楼宇垃圾分类Service业务层处理
 * 
 * @author Dhq
 * @date 2024-09-23
 */
@Service
public class RpBuildingRubbishSortServiceImpl implements IRpBuildingRubbishSortService
{
    @Autowired
    private RpBuildingRubbishSortMapper rpBuildingRubbishSortMapper;

    /**
     * 查询楼宇垃圾分类
     * 
     * @param id 楼宇垃圾分类主键
     * @return 楼宇垃圾分类
     */
    @Override
    public RpBuildingRubbishSort selectRpBuildingRubbishSortById(Long id)
    {
        return rpBuildingRubbishSortMapper.selectRpBuildingRubbishSortById(id);
    }

    /**
     * 查询楼宇垃圾分类列表
     * 
     * @param rpBuildingRubbishSort 楼宇垃圾分类
     * @return 楼宇垃圾分类
     */
    @Override
    public List<RpBuildingRubbishSort> selectRpBuildingRubbishSortList(RpBuildingRubbishSort rpBuildingRubbishSort)
    {
        return rpBuildingRubbishSortMapper.selectRpBuildingRubbishSortList(rpBuildingRubbishSort);
    }

    /**
     * 新增楼宇垃圾分类
     * 
     * @param rpBuildingRubbishSort 楼宇垃圾分类
     * @return 结果
     */
    @Override
    @Integral(IntegralType.RUBBISH_SORTING)
    public int insertRpBuildingRubbishSort(RpBuildingRubbishSort rpBuildingRubbishSort)
    {
        return rpBuildingRubbishSortMapper.insertRpBuildingRubbishSort(rpBuildingRubbishSort);
    }

    /**
     * 修改楼宇垃圾分类
     * 
     * @param rpBuildingRubbishSort 楼宇垃圾分类
     * @return 结果
     */
    @Override
    public int updateRpBuildingRubbishSort(RpBuildingRubbishSort rpBuildingRubbishSort)
    {
        rpBuildingRubbishSort.setUpdateTime(DateUtils.dateTimeNow(DateUtils.YYYY_MM_DD_HH_MM_SS));
        return rpBuildingRubbishSortMapper.updateRpBuildingRubbishSort(rpBuildingRubbishSort);
    }

    /**
     * 批量删除楼宇垃圾分类
     * 
     * @param ids 需要删除的楼宇垃圾分类主键
     * @return 结果
     */
    @Override
    public int deleteRpBuildingRubbishSortByIds(Long[] ids)
    {
        return rpBuildingRubbishSortMapper.deleteRpBuildingRubbishSortByIds(ids);
    }

    /**
     * 删除楼宇垃圾分类信息
     * 
     * @param id 楼宇垃圾分类主键
     * @return 结果
     */
    @Override
    public int deleteRpBuildingRubbishSortById(Long id)
    {
        return rpBuildingRubbishSortMapper.deleteRpBuildingRubbishSortById(id);
    }
}
